package com.cctc.juc.demo.Athread.Astate;

import java.util.concurrent.TimeUnit;

/**
 * 线程状态：限时等待。
 */
public class BTimedWaitingThread implements Runnable {
    @Override
    public void run() {
        while (true) {
            waitSecond(200);
        }
    }

    private void waitSecond(long seconds) {
        try {
            TimeUnit.SECONDS.sleep(seconds);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
